<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="_session_check.jsp" %>
<%@ page import="com.shopping.modean.User"%>
<%@ page import="com.shopping.service.UserService"%>
<%@ page import="com.shopping.util.*"%>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%
	UserService userService = new UserService();
	List<User> users = userService.list();
%>

<!DOCTYPE html>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户列表</title>
</head>

<body>
  <table border="1" align="center">
  	<tr>
  		<td>ID</td>
  		<td>用户名</td>
  		<td>手机号</td>
  		<td>地址</td>
  		<td>注册时间</td>
  		<td>操作</td>
  	</tr>
    
    <%
    	for(User u:users) {
    %>
    <tr>
  		<td><%=u.getId() %></td>
  		<td><%=u.getUsername() %></td>
  		<td><%=u.getPhone() %></td>
  		<td><%=u.getAddr() %></td>
  		<td><%=TimeUtil.getStringFromTime(u.getRdate(), "yyyy-MM-dd HH:mm:ss") %></td>
  		<td><a href="user_delete.jsp?id=<%=u.getId() %>" target="detail">删除</a></td>
  	</tr>
     <% } %>
  </table>
  

</body>
</html>